Dim image As Any Ptr
Dim As Integer X, Y, intPoint
Dim As String strOutput

var iBits=0, sOutput=String$(79, 0)

#define AddBit(iBit) sOutput[iBits\8] or= (iBit) shl (iBits AND 7): iBits += 1

Dim intImage(0 To 24, 0 To 24) As Integer

ScreenRes 320, 240, 2

BLoad "./qr.bmp", image

For X = 0 To 24
	For Y = 0 To 24
		intPoint = Point(X, Y, image)
		AddBit(intPoint)
		intImage(X, Y) = intPoint		
	Next
Next

'For Y = 0 To 24
'	intImage(X, 25) = 1
'Next

Screen 0
Color 15,0
Print String$(27, 219)
For X = 0 To 23 Step 2
	Print Chr(219);
	For Y = 0 To 24
		'Print intImage(X, Y);
		If intImage(X, Y) = 1 And intImage(X+1, Y) = 1 Then Print Chr(219); : strOutPut += Chr(219)
		If intImage(X, Y) = 1 And intImage(X+1, Y) = 0 Then Print Chr(223); : strOutPut += Chr(223)
		If intImage(X, Y) = 0 And intImage(X+1, Y) = 1 Then Print Chr(220); : strOutPut += Chr(220)
		If intImage(X, Y) = 0 And intImage(X+1, Y) = 0 Then Print " "; : strOutPut += " "
	Next
	Print Chr(219)
Next
Print Chr(219);
For Y = 0 To 24
		If intImage(24, Y) = 1 Then Print Chr(219); : strOutPut += Chr(219)
		If intImage(24, Y) = 0 Then Print Chr(220); : strOutPut += Chr(220)
Next
Print Chr(219)
Print String$(27, 223)
Print
Open "qr.txt" for output as #1
	Print #1, strOutput;
Close #1